
function request(url, method,data){


  return new Promise((reslove, reject) => {
    let baseURL="https://api-hmugo-web.itheima.net/api/public/v1/home";
    wx.request({
      url:baseURL+url,
      method:method,
      data:data,
     
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: (res) => {
        reslove(res)
  
      },
      fail: (err) => {
        reject(err)
      }
  
    })

  })

}
export default  request
  